package logic.operation;

import java.awt.Desktop;
import java.io.IOException;
import java.util.List;
import java.util.Observer;

import javax.swing.JProgressBar;

import org.apache.log4j.Logger;

import logic.file.IFile;

public class PreviewOperation extends AbstractFileOperation {
	
	Logger logger = Logger.getLogger(PreviewOperation.class.getName());
	//ta operacja nie implementuje INTERFEJSU Observable!!!
 	public PreviewOperation(List <IFile> files) {
 		super(files);
 	}
 	
 	public PreviewOperation() {	}
 	
	@Override
	public void execute() throws IOException {
		logger.info("Preview operation executed");
		for (IFile f : files) {
			f.open();
		}
		
	}
	@Override
	public void cancel() {
		// TODO Auto-generated method stub
		
	}
	//TODO run zaimplementować wyżej
	@Override
	public void run() {
		try {
			execute();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

	@Override
	public String getName() {
		return "Preview";
	}

}
